<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:output
		encoding="utf-8"
		indent="yes"
		doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
		omit-xml-declaration="yes"
		method="xml" />
	
	<xsl:param name="userGroup" select="/data/@user-group" />
	<xsl:param name="userId" select="/data/@user-id" />
	<xsl:param name="module" select="/data/@module" />
	<xsl:param name="method" select="/data/@method" />
	<xsl:param name="baseURI" select="/data/@base-uri" />
	<xsl:param name="pageTitle" select="/data/@title" />
	<xsl:param name="scode" select="/data/@scode" />
	<xsl:param name="queryString" select="/data/@query-string" />
	
	<!-- Meta-теги стрианицы -->
	<xsl:template name="meta-head">
		<link href="{$baseURI}/favicon.ico" type="image/ico" rel="icon" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" href="{$baseURI}/css/admin/base.css" type="text/css" media="all" />
		<link rel="stylesheet" href="{$baseURI}/css/admin/main.css" type="text/css" media="all" />
		<link rel="stylesheet" href="{$baseURI}/css/admin/dialog.css" type="text/css" media="all" />
				
		<script type="text/javascript">
			var baseURI = "<xsl:value-of select="$baseURI" />";
			var scode = "<xsl:value-of select="$scode" />";
		</script>
		
		<script type="text/javascript" src="{$baseURI}/js/jQuery.js" />
		<script type="text/javascript" src="{$baseURI}/js/jQueryUI.js" />
		<script type="text/javascript" src="{$baseURI}/js/admin/jQuery.drop.js" />
		<script type="text/javascript" src="{$baseURI}/js/admin/messages.js" />
		<script type="text/javascript" src="{$baseURI}/js/simpleEditor.js" />
		<script type="text/javascript" src="{$baseURI}/js/admin/cms.js" />
		<script type="text/javascript" src="{$baseURI}/js/admin/cp.js" />
		<script type="text/javascript" src="{$baseURI}/js/admin/dialogs.js" />
		<link rel="stylesheet" href="{$baseURI}/css/smoothness/jquery-ui-1.7.2.custom.css" type="text/css" media="all" />
	</xsl:template>
	
	<xsl:template name="admin-header">
		<xsl:param name="oUser" select="document(concat('xobject://user/', $userId))/data/object" />
		<xsl:param name="userLogin" select="$oUser/property[@name='login']/value" />
		
		<div id="cms_messages" />
		
		<div id="favorite" class="favorite_dialog" style="display:none">
			<div class="fav_label">избранное</div>
			<div id="favorite_items_wrapper" />
		</div>
		
		<div id="topline">
			<div id="topline_inner">
				<div class="r">
					<xsl:text>Привет, </xsl:text>
					<a href="{$baseURI}/user/{$userLogin}">
						<xsl:value-of select="$oUser/property[@name='name']/value" />
					</a>
					<xsl:text> ∙ </xsl:text>
					<a href="{$baseURI}/users/edit_profile">настроить профиль</a>
					<xsl:text> ∙ </xsl:text>
					<a href="{$baseURI}/users/logout">выйти</a>
				</div>
				<div class="l">
					<a href="{$baseURI}">Перейти на сайт</a>
				</div>
			</div>
		</div>
		
		<div id="logo">
			<a href="{$baseURI}/admin/cp">
				<img src="{$baseURI}/images/admin/logo.png" />
			</a>
		</div>
	</xsl:template>
	
	<!-- Footer -->
	<xsl:template name="footer">
		<div id="footer">
			<xsl:text>© </xsl:text>
			<a href="http://explay.su">Explay CMS</a>
		</div>
	</xsl:template>
	
	<!-- Сообщение -->
	<xsl:template match="response/message">
		<div class="system_message"><xsl:value-of select="." /></div>
	</xsl:template>
	
	<!-- Сообщение об ошибке -->
	<xsl:template match="response/error">
		<div class="system_error"><xsl:value-of select="." /></div>
	</xsl:template>
	
</xsl:stylesheet>